//
//  JWNewsCell.m
//  见闻新闻
//
//  Created by brother on 16/3/9.
//  Copyright © 2016年 JoanBoat. All rights reserved.
//

#import "JWNewsCell.h"
#import "JWNewsModel.h"
#import <UIImageView+WebCache.h>


@interface JWNewsCell ()

@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;

@end

@implementation JWNewsCell

+ (instancetype)newsWithTableView:(UITableView *)tableView {
    static NSString *cellIofo = @"cell";
    JWNewsCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIofo];
    if (cell == nil) {
        UINib *nib = [UINib nibWithNibName:@"JWNewsCell" bundle:nil];
        cell = [[nib instantiateWithOwner:nil options:nil] lastObject];
    }
    return cell;
}

-(void)setNews:(JWNewsModel *)news {
    _news = news;
    self.titleLabel.text = news.title;
    [self.iconImageView sd_setImageWithURL:[NSURL URLWithString:news.images]];
}

@end
